<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="css/common.css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script src="assets/js/jquery.min.js"></script>
<style>
</style>
</head>
<body>
	<div class="topbar-wrap white">
		<div class="topbar-inner clearfix">
			<div class="topbar-logo-wrap clearfix">
				<h1 class="topbar-logo none">
					<a href="index.html" class="navbar-brand">后台管理</a>
				</h1>
				<ul class="navbar-list clearfix">
					<li><a class="on" href="index.html">首页</a></li>
					<li><a href="#" target="_blank">网站首页</a></li>
				</ul>
			</div>
			<div class="top-info-wrap">
				<ul class="top-info-list clearfix">
					<li><a href="#">管理员</a></li>
					<li><a href="#">修改密码</a></li>
					<li><a href="#">退出</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container clearfix">
		<div class="sidebar-wrap">
			<div class="sidebar-title">
				<h1>菜单</h1>
			</div>
			<div class="sidebar-content">
				<ul class="sidebar-list">
					<li><a href="#"><i class="icon-font">&#xe003;</i>常用操作</a>
						<ul class="sub-menu">
							<li><a href="index.html"><i class="icon-font">&#xe008;</i>用户管理</a></li>
							<li><a href="products.html"><i class="icon-font">&#xe005;</i>作品管理</a></li>
							<li><a href="sowing.html"><i class="icon-font">&#xe006;</i>轮播图管理</a></li>
							<li><a href="index.html"><i class="icon-font">&#xe004;</i>留言管理</a></li>
							<li><a href="index.html"><i class="icon-font">&#xe012;</i>评论管理</a></li>
							<li><a href="index.html"><i class="icon-font">&#xe052;</i>友情链接</a></li>
							<li><a href="index.html"><i class="icon-font">&#xe033;</i>广告管理</a></li>
						</ul></li>
					<li><a href="#"><i class="icon-font">&#xe018;</i>系统管理</a>
						<ul class="sub-menu">
							<li><a href="system.html"><i class="icon-font">&#xe017;</i>系统设置</a></li>
							<li><a href="system.html"><i class="icon-font">&#xe037;</i>清理缓存</a></li>
							<li><a href="system.html"><i class="icon-font">&#xe046;</i>数据备份</a></li>
							<li><a href="system.html"><i class="icon-font">&#xe045;</i>数据还原</a></li>
						</ul></li>
				</ul>
			</div>
		</div>
		<!--/sidebar-->
		<div class="main-wrap">

			<div class="crumb-wrap">
				<div class="crumb-list">
					<i class="icon-font"></i><a href="index.html">首页</a><span
						class="crumb-step">&gt;</span><span class="crumb-name">作品管理</span>
				</div>
			</div>
			<div class="search-wrap">
				<div class="search-content">
					<form action="#" method="post">
					</form>
				</div>
			</div>
			<div class="result-wrap">
				<form name="myform" id="myform" method="post">
					<div class="result-title">
						<div class="result-list">
							<a id="add" href="addsowing.html"><i
								class="icon-font"></i>添加轮播图</a> <a id="updateOrd"
								href="javascript:void(0)"><i class="icon-font"></i>更新排序</a>
						</div>
					</div>
					<div class="result-content">
						<table class="result-tab" width="100%">
							<tr >
								<th class="tc" width="5%"><input class="allChoose" name=""
									type="checkbox"></th>
								<th class="allChoose">名称</th>
								<th class="allChoose">缩略图</th>
								<th class="allChoose">位置</th>
								<th class="allChoose">操作</th>
							</tr>

						</table>
						<div class="list-page"></div>
					</div>
				</form>
			</div>
		</div>
		<!--/main-->
	</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
		$.post("selectSowing",{"pagemodel.currentPage":1},function(data){
				$(".list-page").html( "10 条"+ data.page.currentPage+"/"+data.page.totalPage +"页");
				var table = $(".result-tab");
				for ( var a in data.photo) {
					table.append('<tr>'+
					'<th class="tc" width="5%"><input class="allChoose" name=""'+
						'type="checkbox"></th>'+
					'<th class="allChoose">'+data.photo[a].name+'</th>'+
					'<th class="allChoose"><img alt="" src="'+data.photo[a].url+'" width="50px"></th>'+
					'<th class="allChoose">'+data.photo[a].position+'</th>'+
					'<th class="allChoose">'+
					  '<a class="link-update" href="updateSowing.html?id='+data.photo[a].id+'">编辑&emsp;</a>'+
                      '<a class="link-del" href="#" name="'+data.photo[a].id+'">删除&emsp;</a>'+
					'</th>'+
				'</tr>')
				}
				$(".link-del").click(function(){
					var id = $(this).attr("name");
					$.post("deletesowing", {"photo.id":id}, function(data){
							if (data.result) {
								alert("删除成功");
								window.location.reload();
							} else {
								alert("删除失败");
							}
						})
				})
	})
})
</script>
</html>